Codexによる実装計画レビューループ機能の初期実装 - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issueURL
#3
この PR で対応する範囲 / この PR で対応しない範囲
対応する範囲
planloopにレビューループの基本機能(planloop run,planloop status,planloop init)を実装対応しない範囲
変更点概要
なぜこの実装か
Zenn記事「AIコーディングの技術負債・理解負債排除手法」 のステップ2.2〜2.5で手動実施しているレビュー往復(最大10往復以上)を自動化するため。現状は都度Markdownファイルパスを変えてCodexにレビューを依頼し、結果をClaude Codeに渡す作業を手動で行っている。
アーキテクチャの選択理由
claude -p,codex exec)をchild_processで呼び出す。認証やレート制限の問題を回避するため--output-schema)でレビュー結果をJSON形式で取得。additionalProperties: falseと全プロパティのrequired指定が必要(OpenAI APIの制約)実機テストで得られた知見と対応
実機テスト(別プロジェクト
lgtm-cat-ai-agentsで検証)の過程で以下を修正済み:additionalProperties: false、nullablelineRef)null→undefined変換(z.string().nullable().optional().transform())claude -p --output-format stream-jsonに--verboseが必要settledフラグ)実機テストの結論
スタンドアロンCLI方式では以下の限界が判明し、Claude Codeスラッシュコマンドとしての再実装を #4 として起票済み:
レビュアーに重点的にチェックして欲しい点
src/adapters/codex-cli.ts: OpenAI Structured Output制約への対応が正しいか(additionalProperties: false、nullablelineRef、requiredに全プロパティ)src/core/loop-runner.ts: ループの停止条件(no_blocking_findings, stagnation, max_rounds, human_abort)の正しさsrc/core/triage.ts: HTMLコメントベースのフィードバック抽出ロジックtsconfig.json:types: ["node"]の追加が既存の設定と矛盾しないか補足情報
commander,zod,yaml,picocolors(全て.npmrcのsave-exact=trueによりバージョン固定)